/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryUserLocation;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryUserLocationSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryUserLocation record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_user_location");

                if (record.getId() != null) {
                    VALUES("id", "#{id,jdbcType=INTEGER}");
                }

                if (record.getUserId() != null) {
                    VALUES("user_id", "#{userId,jdbcType=INTEGER}");
                }

                if (record.getLatitude() != null) {
                    VALUES("latitude", "#{latitude,jdbcType=DOUBLE}");
                }

                if (record.getLongitude() != null) {
                    VALUES("longitude", "#{longitude,jdbcType=DOUBLE}");
                }

                if (record.getSpeed() != null) {
                    VALUES("speed", "#{speed,jdbcType=DOUBLE}");
                }

                if (record.getAccuracy() != null) {
                    VALUES("accuracy", "#{accuracy,jdbcType=DOUBLE}");
                }

                if (record.getAltitude() != null) {
                    VALUES("altitude", "#{altitude,jdbcType=DOUBLE}");
                }

                if (record.getVerticalaccuracy() != null) {
                    VALUES("verticalAccuracy", "#{verticalaccuracy,jdbcType=DOUBLE}");
                }

                if (record.getHorizontalaccuracy() != null) {
                    VALUES("horizontalAccuracy", "#{horizontalaccuracy,jdbcType=DOUBLE}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryUserLocation record) {
        return new SQL() {
            {
                UPDATE("delivery_user_location");

                if (record.getUserId() != null) {
                    SET("user_id = #{userId,jdbcType=INTEGER}");
                }

                if (record.getLatitude() != null) {
                    SET("latitude = #{latitude,jdbcType=DOUBLE}");
                }

                if (record.getLongitude() != null) {
                    SET("longitude = #{longitude,jdbcType=DOUBLE}");
                }

                if (record.getSpeed() != null) {
                    SET("speed = #{speed,jdbcType=DOUBLE}");
                }

                if (record.getAccuracy() != null) {
                    SET("accuracy = #{accuracy,jdbcType=DOUBLE}");
                }

                if (record.getAltitude() != null) {
                    SET("altitude = #{altitude,jdbcType=DOUBLE}");
                }

                if (record.getVerticalaccuracy() != null) {
                    SET("verticalAccuracy = #{verticalaccuracy,jdbcType=DOUBLE}");
                }

                if (record.getHorizontalaccuracy() != null) {
                    SET("horizontalAccuracy = #{horizontalaccuracy,jdbcType=DOUBLE}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}